﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace MapEditor
{
    /// <summary>
    /// Interaction logic for frmNew.xaml
    /// </summary>
    public partial class frmNew : Window
    {
        public frmNew()
        {
            InitializeComponent();
        }

        private void btnew_Click(object sender, RoutedEventArgs e)
        {
            if (MySetSize != null)
            {
                int size = 800;

                while (size < Convert.ToInt32(tbHeight.Text))
                {
                    size = size * 2;
                }
                MySetSize(size, size);
            }
            this.Close();
        }

        private void btcancel_Click(object sender, RoutedEventArgs e)
        {

            this.Close();
        }

        public delegate void SetMapSize(int width, int height);
        public SetMapSize MySetSize;
    }
}
